#测试全局变量和局部变量的效率
import math
import time
def test01():
    start = time.time()
    for i in range(1000000):
        math.sqrt(50)
    end=time.time()
    print("耗时={}".format(end-start))


def test02():
    start = time.time()
    b=math.sqrt
    for i in range(1000000):
        b(50)
    end=time.time()
    print("耗时={}".format(end-start))

test01()
test02()